<?php
include("../include/dbcommon.php");

$file_name="new_report_6";
$xml = simplexml_load_file("source/".$file_name.".rptdesign");

$host_regen=$host;
$sys_dbname_regen=$sys_dbname;
$user_regen=$user;
$port_regen=$port?":".$port:"";
$pwd_regen=$pwd?base64_encode($pwd):"";

$xml->{'data-sources'}->{'oda-data-source'}->{'property'}[1]="jdbc:mysql://".$host_regen.$port_regen."/".$sys_dbname_regen;
$xml->{'data-sources'}->{'oda-data-source'}->{'property'}[2]=$user_regen;
$xml->{'data-sources'}->{'oda-data-source'}->{'encrypted-property'}=$pwd_regen;
$xmlstring=$xml->asXML();

 
$fp = fopen('tmp/'.date('Ymdhmi').'_'.$file_name.'.rptdesign', 'w');
fwrite($fp,$xmlstring);
fclose($fp);
?>
